package simulator.software;

/**
 * Interrupt to alert its owning process that its I/O request has been
 * completed.
 * 
 * @author Kyle Loomis
 * 
 */
public class IOInterrupt extends Interrupt
{
   protected Process process = null;

   /**
    * Creates a new I/O interrupt to occur on the given step for the specified
    * process.
    * 
    * @param step
    *           the simulation step on which the interrupt will occur
    * @param p
    *           the process waiting for the I/O
    */
   public IOInterrupt(int step, Process p)
   {
      super(step);
      process = p;
   }

   public String getDescription()
   {
      return "I/O";
   }

   /**
    * Gets the process waiting on I/O.
    * 
    * @return the process waiting on I/O.
    */
   public Process getProcess()
   {
      return process;
   }
}
